<template>
  <div id="list">
    <div>
      <img :src="textareText" class="pic" />
    </div>
    <h1>{{name}}</h1>
    <button @click="back">后退</button>
  </div>
</template>

<style lang="scss">
* {
  box-sizing: border-box;
  list-style: none;
  padding: 0;
  margin: 0;
}
#list {
  width: 300px;
  height: 500px;
  margin: 20px auto;
  background: rgba(255, 0, 0, 0.3);
  .pic {
    margin: 20px;
    width: 200px;
    background-color: white;
  }
  h1 {
    padding-top: 20px;
  }
  button {
    margin-top: 20px;
    width: 150px;
    height: 50px;
    border: none;
    outline: none;
    color: white;
    letter-spacing: 5px;
    cursor: pointer;
    background-color: rgb(236, 87, 87);
  }
}
</style>
<script>
export default {
  name: "list",
  data() {
    return {
      textareText: "",
      name: ""
    };
  },
  created() {
    this.getParams();
  },
  methods: {
    getParams() {
      var routerParams = this.$route.params.nameId;
      var routerName = this.$route.params.name;
      this.textareText = routerParams;
      this.name = routerName;
    },
    back() {
      this.$router.go(-1);
    }
  }
};
</script>
